function abrirPag(valor,div){
    var url = valor;

    xmlRequest.open("GET",url,true);    
    xmlRequest.onreadystatechange = mudancaEstado(div);
    xmlRequest.send(null);

        if (xmlRequest.readyState == 1) {
            document.getElementById(div).innerHTML = "<img src='loader.gif'>";
        }

    return url;
}

function mudancaEstado(div){
    if (xmlRequest.readyState == 4){
        document.getElementById(div).innerHTML = xmlRequest.responseText;
    }
}